Skip to content

feat: add go bindings for ant-ffi#23

Merged
Nic-dorman merged 8 commits intomaidsafe:mainfrom
Nic-dorman:feat/go-bindings
Feb 6, 2026
Merged

feat: add go bindings for ant-ffi#23
Nic-dorman merged 8 commits intomaidsafe:mainfrom
Nic-dorman:feat/go-bindings

Conversation

@Nic-dorman
Copy link
Contributor

Summary

  • Complete Go bindings using CGO to call the Rust FFI library
  • Core types: SecretKey, PublicKey, Chunk, ChunkAddress, DataMapChunk
  • Self-encryption: Encrypt/Decrypt functions with streaming support
  • Key derivation: MainSecretKey, DerivedSecretKey, DerivationIndex, Signature
  • Network types: Pointer, Scratchpad, Register, GraphEntry, Vault, Archive
  • Client operations with context.Context for cancellation/timeout support
  • Network and Wallet configuration (local and custom RPC)
  • Handle wrappers with Go finalizers for automatic memory management

Files

  • go/antffi/*.go - 18 source files
  • go/antffi_test/*.go - 4 test files
  • go/go.mod - Module definition

Test plan

  • Unit tests pass (go test ./...)
  • Integration tests pass against local network (go test -tags=integration ./...)
  • 36 tests passing (35 pass, 1 skip for optional custom network config)

Nic-dorman and others added 5 commits February 5, 2026 11:10
Go bindings using CGO to call the Rust FFI library. Includes:
- Core types: SecretKey, PublicKey, Chunk, DataMapChunk
- Self-encryption: Encrypt/Decrypt functions
- Key derivation: MainSecretKey, DerivedSecretKey, DerivationIndex
- Network types: Pointer, Scratchpad, Register, GraphEntry, Vault
- Async client operations with context cancellation support
- Network and Wallet configuration
- Comprehensive unit and integration tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Runs on push/PR to main:
- Builds Rust FFI library
- Builds Go bindings with CGO
- Runs unit tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The dependabot bump to 0.10.0 was incomplete. This adds the required
API changes:

- Network::custom() now takes 4th parameter (royalties_pk_hex)
- file_cost() now takes follow_symlinks and include_hidden params
- dir_upload/dir_upload_public now take Wallet directly
- file_content_upload uses BulkPaymentOption via .into()
- dir_content_upload uses BulkPaymentOption via .into()

Updated bindings:
- PHP: Network.php, RustBuffer.php, ant_ffi.h
- Swift: Regenerated UniFFI bindings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Nic-dorman and others added 3 commits February 5, 2026 14:40
- Add 7 cost estimation methods: ChunkCost, PointerCost, ScratchpadCost,
  RegisterCost, VaultCost, GraphEntryCost, ArchiveCost
- Add pointer operations: PointerCreate, PointerUpdate, PointerCheckExistence
- Add scratchpad operations: ScratchpadGetFromPublicKey, ScratchpadCreate,
  ScratchpadUpdate, ScratchpadCheckExistence
- Add graph entry operation: GraphEntryCheckExistence
- Add directory operations: DirUpload, DirUploadPublic, DirDownload, DirDownloadPublic
- Add unit tests for cost methods
- Add E2E integration test for upload/download roundtrip

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unnecessary underscore assignment for pollVoidFuture which only returns error
- Fix test to use Price field instead of Cost in UploadResult

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds C#, Lua, and Dart bindings from upstream.
Adds Go section to README and Go ignores to .gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit bf8753b into maidsafe:main Feb 6, 2026
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant